import Vue from "vue"
import Router from "vue-router"
// import Home from "@/components/Home.vue"

Vue.use(Router)
export default new Router({
    routes: [{
        path: '/',
        hidden: true,
        redirect: '/login'
    }, {
        path: '/login',
        name: 'LoginPage',
        hidden: true,
        component: () => import('@/components/LoginPage') // 路由懒加载
    }, /*{
        path: '*',
        name: 'NotFoundPage',
        hidden: true,
        component: () => import('@/components/NotFound')// 异步懒加载
    },*/ /*{
            path: '/home',
            // component: Home
            // component: () => import('@/components/Home.vue') // 路由懒加载
            component: resolve => require(['@/components/Home.vue'], resolve) // 异步懒加载
        },*/ {
        path: '/home',
        redirect: '/home/student',
        name: '学生管理',
        iconClass: 'fa fa-users',
        component: () => import('@/components/Home'),
        children: [{
            path: '/home/student',
            name: '学生列表',
            iconClass: 'fa fa-list',
            component: () => import('@/stu/StudentList')
        }, {
            path: '/home/info',
            name: '信息列表',
            iconClass: 'fa fa-list-alt',
            component: () => import('@/stu/InfoList')
        }, {
            path: '/home/infos',
            name: '信息管理',
            iconClass: 'fa fa-list-alt',
            component: () => import('@/stu/InfoManage')
        }, {
            path: '/home/work',
            name: '作业列表',
            iconClass: 'fa fa-list-ul',
            component: () => import('@/stu/WorkList')
        }, {
            path: '/home/works',
            name: '作业管理',
            iconClass: 'fa fa-th-list',
            component: () => import('@/stu/WorkManage')
        }]
    }, {
        path: '/home',
        name: '数据分析',
        iconClass: 'fa fa-bar-chart',
        component: () => import('@/components/Home'),
        children: [{
            path: '/home/datview',
            name: '数据概览',
            iconClass: 'fa fa-bar-chart',
            component: () => import('@/dataAnalysis/DataView.vue')
        }, {
            path: '/home/mapview',
            name: '地图概览',
            iconClass: 'fa fa-line-chart',
            component: () => import('@/dataAnalysis/MapView.vue')
        }, {
            path: '/home/travel',
            name: '旅游地图',
            iconClass: 'fa fa-line-chart',
            component: () => import('@/dataAnalysis/TravelMap.vue')
        }, {
            path: '/home/score',
            name: '分数地图',
            iconClass: 'fa fa-line-chart',
            component: () => import('@/dataAnalysis/ScoreMap.vue')
        }]
    }, {
        path: '/home',
        name: '用户中心',
        iconClass: 'fa fa-user',
        component: () => import('@/components/Home.vue'),
        children: [{
            path: '/user/auth',
            name: '权限管理',
            iconClass: 'fa fa-user',
            component: () => import('@/user/UserAuth.vue')
        }]
    }],
    mode: "history",
})
